local beimang = fk.CreateSkill{
  name = "pegasus__beimang",
  tags = { Skill.Limited },
}

Fk:loadTranslationTable {
  ["pegasus__beimang"] = "背芒",
  [":pegasus__beimang"] = "限定技，同势力角色造成或受到伤害时，你令此伤害+1，受伤角色于结算完成后回复1点体力或摸两张牌。",

  ["#pegasus__beimang-ivk"] = "背芒：是否令 %src 受到的伤害+1？"
}

beimang:addEffect(fk.DamageInflicted, {
  anim_type = "offensive",
  can_trigger = function (self, event, target, player, data)
    if player:hasSkill(beimang.name) and player:usedSkillTimes(beimang.name, Player.HistoryGame) == 0 then
      return player.kingdom == target.kingdom
    end
  end,
  on_cost = function (self, event, target, player, data)
    return player.room:askToSkillInvoke(player, { skill_name = beimang.name, prompt = "#pegasus__beimang-ivk:"..data.to.id })
  end,
  on_use = function (self, event, target, player, data)
    local room = player.room
    room:doIndicate(player, {data.to})
    data:changeDamage(1)
  end,
})

beimang:addEffect(fk.DamageCaused, {
  anim_type = "offensive",
  can_trigger = function (self, event, target, player, data)
    if player:hasSkill(beimang.name) and player:usedSkillTimes(beimang.name, Player.HistoryGame) == 0 then
      return player.kingdom == target.kingdom
    end
  end,
  on_cost = function (self, event, target, player, data)
    return player.room:askToSkillInvoke(player, { skill_name = beimang.name, prompt = "#pegasus__beimang-ivk:"..data.to.id })
  end,
  on_use = function (self, event, target, player, data)
    local room = player.room
    room:doIndicate(player, {data.to})
    data:changeDamage(1)
  end,
})

return beimang